//
// Created by yangjian on 19-3-14.
//
#include "link.c"

int main() {

	link_list_t * link = new_link_list();
	link_list_node_t * node;
	char data[20];
	printf("++++++++++++ Add data to the list ++++++++++++++++++++ : %d\n", link->size);
	for (int i = 0; i < 100; ++i) {
		sprintf(data, "test-data-%d", i);
		link_list_add(link, data);
	}
	printf("[link size] : %d\n", link->size);
	printf("++++++++++++ Traversing the list ++++++++++++++++++++ : %d\n", link->size);
	// walk the list
	node = link->head;
	while (node->next != NULL) {
		printf("[link data] : %s\n", (char *) node->value);
		node = node->next;
	}
	link_list_destroy(link, NULL);
	return 0;
}